var t,
  e = require("../../../../utils/jump"),
  i =
    (t = require("../../../../config/page")) && t.__esModule
      ? t
      : { default: t },
  s = require("@/services/list");
Component({
  data: { swiperCurrent: 6, circleCurrent: 0, list: [], albums: [] },
  lifetimes: {
    attached: function () {
      var t = (0, s.getStoryList)(),
        e = [
          "https://industry.map.qq.com/cloud/file/2023/06/27/1687853651756_eTfFbB3H.png",
          "https://industry.map.qq.com/cloud/file/2023/06/27/1687853660022_5bszHHEX.png",
          "https://industry.map.qq.com/cloud/file/2023/06/27/1687853667336_ZjRmhYx9.png",
          "https://industry.map.qq.com/cloud/file/2023/06/27/1687853673690_7BPfCAx2.png",
          "https://industry.map.qq.com/cloud/file/2023/06/27/1687853681430_3T2J3Nwk.png",
          "https://industry.map.qq.com/cloud/file/2023/06/27/1687853688604_YGEK21xZ.png",
          "https://industry.map.qq.com/cloud/file/2023/06/27/1687853696631_cSNYGAkz.png",
          "https://industry.map.qq.com/cloud/file/2023/06/27/1687853701310_7hn8YAeQ.png",
        ],
        i = t.map(function (t, i) {
          return {
            title: t.title,
            bg: e[i],
            items: t.itemList.map(function (t, e) {
              var i = { mid: t.mid, name: t.name, style: "" };
              return (
                0 === e
                  ? (i.style = "position: absolute;top: 46%;left: 10%;")
                  : 1 === e
                    ? (i.style = "position: absolute;top:53%;right: 3%;")
                    : 2 === e
                      ? (i.style = "position: absolute;top: 44%;right: 12%;")
                      : 3 === e
                        ? (i.style = "position: absolute;top: 52%;left: 24%;")
                        : 4 === e
                          ? (i.style = "position: absolute;top: 62%;left: 59%;")
                          : 5 === e
                            ? (i.style =
                                "position: absolute;top: 78%;left: 8%;")
                            : 6 === e
                              ? (i.style =
                                  "position: absolute;top: 81%;right: 0%;")
                              : 7 === e
                                ? (i.style =
                                    "position: absolute;top: 88%;left: 16%;")
                                : 8 === e
                                  ? (i.style =
                                      "position: absolute;top: 88%;right: 2%;")
                                  : 9 === e
                                    ? (i.style =
                                        "position: absolute;top: 58%;left: 28%;")
                                    : 10 === e
                                      ? (i.style =
                                          "position: absolute;top: 42%;left: 18%;")
                                      : 11 === e
                                        ? (i.style =
                                            "position: absolute;top: 75%;right: 2%;")
                                        : 12 === e
                                          ? (i.style =
                                              "position: absolute;top: 38%;left: 16%;")
                                          : 13 === e
                                            ? (i.style =
                                                "position: absolute;top: 63%;right: 39%;")
                                            : 14 === e
                                              ? (i.style =
                                                  "position: absolute;top: 70%;right: 8%;")
                                              : 15 === e
                                                ? (i.style =
                                                    "position: absolute;top: 70%;left: 8%;")
                                                : 16 === e
                                                  ? (i.style =
                                                      "position: absolute;top: 82%;right: 33%;")
                                                  : 17 === e &&
                                                    (i.style =
                                                      "position: absolute;top: 47%;right: 1%;"),
                i
              );
            }),
          };
        });
      this.setData({ list: i, albums: e });
    },
  },
  methods: {
    goNext: function () {
      this.data.swiperCurrent >= this.data.albums.length - 1
        ? this.setData({ swiperCurrent: 0 })
        : this.setData({ swiperCurrent: this.data.swiperCurrent + 1 });
    },
    changeSwiper: function (t) {
      var e = t.detail.current,
        i = this.data.circleCurrent;
      (i = e <= 5 ? e + 2 : e - 6),
        this.setData({ swiperCurrent: e, circleCurrent: i });
    },
    goBefore: function () {
      this.data.swiperCurrent <= 0
        ? this.setData({ swiperCurrent: this.data.albums.length - 1 })
        : this.setData({ swiperCurrent: this.data.swiperCurrent - 1 });
    },
    handleTapCircle: function (t) {
      var e = t.currentTarget.dataset.index;
      console.log(e);
      var i = 0;
      (i = e <= 1 ? 6 + e : e - 2),
        this.setData({ swiperCurrent: i, circleCurrent: e });
    },
    goCulturalCard: function (t) {
      var s = t.currentTarget.dataset,
        o = s.index,
        r = s.id,
        a = this.data.circleCurrent;
      console.log(t),
        (0, e.navigateTo)(i.default.PAGE_APPRECIATION_PAGES_STORY_INDEX, {
          categoryIndex: a,
          id: r,
          index: o,
        });
    },
  },
});
